home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Collections: Purity
/
Purity #23 (1994-02-10)(Diesel)(DE)[WB].zip
/
Purity #23 (1994-02-10)(Diesel)(DE)[WB].adf
/
DesignerDemo
/
buttondemo
/
ButtonDemo.c
< prev
next >
Wrap
C/C++ Source or Header
|
1994-01-20
|
898b
|
47 lines
/* Simple demo using a Designer created file */
/* Only run from CLI */
#include <buttondemowin.c>
void main(void)
{
int done=0;
ULONG class;
UWORD code;
struct Gadget *pgsel;
struct IntuiMessage *imsg;
if (OpenLibs()==0)
{
if (OpenWindowDisplayWindow()==0)
{
while (done==0)
{
Wait(1L << DisplayWindow->UserPort->mp_SigBit);
imsg=GT_GetIMsg(DisplayWindow->UserPort);
while (imsg != NULL )
{
class=imsg->Class;
code=imsg->Code;
pgsel=(struct Gadget *)imsg->IAddress; /* Only reference if it is a gadget message */
GT_ReplyIMsg(imsg);
switch (class)
{
case IDCMP_CLOSEWINDOW :
done=1;
break;
case IDCMP_GADGETUP :
done=1;
break;
};
imsg=GT_GetIMsg(DisplayWindow->UserPort);
}
}
CloseWindowDisplayWindow();
}
else
printf("Cannot open window.\n");
}
else
printf("Cannot open libraries.\n");
}